<HTML><HEAD><TITLE>event_retrieve(+EventHandle, -Goal, -Module)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Event Handling</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>event_retrieve(+EventHandle, -Goal, -Module)</H1>
Given the handle with which an event is associated, retrieve the event goal and module
<DL>
<DT><EM>EventHandle</EM></DT>
<DD>An event handle
</DD>
<DT><EM>Goal</EM></DT>
<DD>A free variable or goal to unify
</DD>
<DT><EM>Module</EM></DT>
<DD>A free variable or module name
</DD>
</DL>
<H2>Description</H2>
	The goal associated with an event handle, created using event_create/3,
	is retrieved using this predicate. It also returns the context module
	in which the event was created (and where the goal should be called).
    <P>
	Like event creation, retrieval of the goal produces a copy of the
	goal. As a result, if the goal contains variables, they lose their
	identity and are replaced with fresh ones.
    <P>
        If the event was disabled, the goal 'true' is retrieved instead of the
	original goal.
    
<H3>Modes and Determinism</H3><UL>
<LI>event_retrieve(+, -, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>EventHandle is un-instantiated
<DT><EM>(5) type error </EM>
<DD>EventHandle is not a handle
</DL>
<H2>Examples</H2>
<PRE>    ?- event_create(writeln('Hello world!'), [], Event),
    	event_retrieve(Event, EventGoal, Module).

    Event = 'EVENT'(16'50421bd0)
    EventGoal = writeln('Hello world!')
    Module = eclipse
    Yes (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../kernel/event/event_create-3.html">event_create / 3</A>, <A HREF="../../kernel/event/event-1.html">event / 1</A>, <A HREF="../../kernel/event/event_after-2.html">event_after / 2</A>, <A HREF="../../kernel/event/event_after-3.html">event_after / 3</A>, <A HREF="../../kernel/event/event_after_every-2.html">event_after_every / 2</A>, <A HREF="../../kernel/event/set_event_handler-2.html">set_event_handler / 2</A>, <A HREF="../../kernel/event/current_after_events-1.html">current_after_events / 1</A>, <A HREF="../../kernel/event/cancel_after_event-2.html">cancel_after_event / 2</A>, <A HREF="../../kernel/typetest/is_event-1.html">is_event / 1</A>, <A HREF="../../kernel/event/event_disable-1.html">event_disable / 1</A>, <A HREF="../../kernel/event/event_enable-1.html">event_enable / 1</A>
</BODY></HTML>
